home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / etc / init.d / keyboard-setup < prev    next >
Encoding:
Text File  |  2006-11-23  |  1.1 KB  |  51 lines

  1. #!/bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides:          keymap
  4. # Required-Start:    mountkernfs udev
  5. # Default-Start:     S
  6. # Short-Description: Set preliminary keymap
  7. # Description:       Set the console keyboard as early as possible
  8. #                    so during the file systems checks the administrator
  9. #                    can interact.  At this stage of the boot process
  10. #                    only the ASCII symbols are supported.
  11. ### END INIT INFO
  12.  
  13. set -e
  14.  
  15. test -f /bin/setupcon || exit 0
  16.  
  17. if [ -f /lib/lsb/init-functions ]; then
  18.     . /lib/lsb/init-functions
  19. else
  20.     log_action_begin_msg () {
  21.     echo -n "$@... "
  22.     }
  23.  
  24.     log_action_end_msg () {
  25.     if [ "$1" -eq 0 ]; then 
  26.         echo done.
  27.     else
  28.         echo failed.
  29.     fi
  30.     }
  31. fi
  32.  
  33. case "$1" in
  34.     stop)
  35.         # keyboard-setup isn't a daemon
  36.         ;;
  37.     start|force-reload|restart|reload)
  38.     log_action_begin_msg "Setting preliminary keymap"
  39.     if setupcon -k --force; then
  40.         log_action_end_msg 0
  41.     else
  42.         log_action_end_msg $?
  43.     fi
  44.     ;;
  45.     *)
  46.         echo 'Usage: /etc/init.d/keyboard-setup {start|reload|restart|force-reload|stop}'
  47.         exit 1
  48.         ;;
  49. esac
  50.  
  51.